home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’97 / Warrior’s Progress / source code / Source / Libraries / Application / Application.h < prev    next >
Encoding:
Text File  |  1997-06-28  |  1.4 KB  |  71 lines  |  [TEXT/CWIE]

  1. // Application.h
  2.  
  3. #ifndef Application_h
  4. #define Application_h
  5.  
  6. #ifndef EventMaker_h
  7. #include "EventMaker.h"
  8. #endif
  9. #ifndef CommandHandler_h
  10. #include "CommandHandler.h"
  11. #endif
  12. #ifndef ContextFree_h
  13. #include "ContextFree.h"
  14. #endif
  15. #ifndef Quitting_h
  16. #include "Quitting.h"
  17. #endif
  18. #ifndef ScreenPartMaker_h
  19. #include "ScreenPartMaker.h"
  20. #endif
  21. #ifndef WindowLocator_h
  22. #include "WindowLocator.h"
  23. #endif
  24. #ifndef KeyMessageMaker_h
  25. #include "KeyMessageMaker.h"
  26. #endif
  27. #ifndef RootFocus_h
  28. #include "RootFocus.h"
  29. #endif
  30. #ifndef PreparingToQuit_h
  31. #include "PreparingToQuit.h"
  32. #endif
  33. #ifndef Broadcaster_h
  34. #include "Broadcaster.h"
  35. #endif
  36.  
  37. class Application: public ContextFree,
  38.                          public EventMaker,
  39.                          public ScreenPartMaker,
  40.                          public WindowLocator,
  41.                          public KeyMessageMaker,
  42.                          public CommandHandler< Quitting >,
  43.                          public Broadcaster< PreparingToQuit >
  44.   {
  45.     private:
  46.         bool quitting;
  47.         
  48.         static Application *the;
  49.         
  50.         // not implemented:
  51.             Application( const Application& );
  52.             void operator=( const Application& );
  53.         
  54.     protected:
  55.         Application();
  56.         ~Application();
  57.         
  58.     public:
  59.         static Application& The()             { Assert( the != 0 ); return *the; }
  60.         
  61.         RootFocus& Focus()                    { return RootFocus::The(); }
  62.         const RootFocus& Focus() const    { return RootFocus::The(); }
  63.         
  64.         virtual void Run();
  65.         
  66.         virtual bool CanQuit() const;
  67.         virtual void Quit( SavingOption save = SavingOption::ask );
  68.   };
  69.  
  70. #endif
  71.